
#ifndef VBOXLAYOUTPANEL_H
#define VBOXLAYOUTPANEL_H

#include <BLineEdit>
#include <BCheckBox>
#include <BSpinBox>
#include <BGroupBox>
#include <BComboBox>
#include <BGridLayout>
#include <BTableWidget>
#include <BFloatSpinBox>
#include "PolicyMenu.h"

using namespace BWE;

class VBoxLayoutPanel : public BGroupBox
{
public:
	VBoxLayoutPanel(BWidget* parent = 0);

protected:
	void freshRowTableWidget();
	void freshColumnTableWidget();

protected:
	void slotAssetChanged(BObject* object, const BValue& value);

	void slotNameEditFinished(BObject* object, const BValue& value);
	void slotEnabledToggled(BObject* object, const BValue& value);
	void slotSplitableToggled(BObject* object, const BValue& value);
	void slotMarginEditFinished(BObject* object, const BValue& value);
	void slotSpacingEditFinished(BObject* object, const BValue& value);
	void slotPartItemClicked(BObject* object, const BValue& value);

	void slotGridRowEditFinished(BObject* object, const BValue& value);
	void slotGridColumnEditFinished(BObject* object, const BValue& value);
	void slotTableItemRightClicked(BObject* object, const BValue& value);

	void slotPolicyMenuTrigger();
	void slotStretchEditFinished();

private:
	BLineEdit*			_nameEdit;
	BCheckBox*			_enabledCheckBox;
	BCheckBox*			_splitableCheckBox;
	BLineEdit*			_marginEdit;
	BSpinBox*			_spacingSpinBox;
	BComboBox*			_partComboBox;
	
	BHolder<BGroupBox>	_groupBox;
	BSpinBox*			_rowSpinBox;
	BTableWidget*		_rowTableWidget;
	BSpinBox*			_columnSpinBox;
	BTableWidget*		_columnTableWidget;
	BHolder<PolicyMenu>	_policyMenu;
	BFloatSpinBox*		_stretchSpinBox;
};

#endif
